package com.bdqn.bookshop.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.bdqn.bookshop.entity.Garousel;
import com.bdqn.bookshop.utils.DataGridViewResult;
import com.bdqn.bookshop.utils.Result;
import com.bdqn.bookshop.vo.GarouselVo;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author : 罗若然[LUO_RUO_RAN]
 * @date : 2020-07-24 15:56
 **/
public interface GarouselService extends IService<Garousel> {

    /**
     * 添加轮播图
     * @param file
     * @param garousel
     * @return
     */
    Result addGarousel(MultipartFile file, Garousel garousel, HttpServletRequest request);

    /**
     * 修改轮播图
     * @param file
     * @param garousel
     * @param request
     * @return
     */
    Result updateGarousel(MultipartFile file, Garousel garousel, HttpServletRequest request);

    /**
     * 删除轮播图
     * @param id
     * @return
     */
    Result deleteById(Integer id,String imageUrl,HttpServletRequest request);

    /**
     * 批量删除
     * @param ids
     * @param images
     * @param request
     * @return
     */
    Result batchDelete(String ids, String images, HttpServletRequest request);

    /**
     * 分页查询数据
     * @param garouselVo
     * @return
     */
    DataGridViewResult garouselList(GarouselVo garouselVo);

    /**
     * 判断排序是否重复
     * @param id
     * @param sort
     * @return
     */
    Result isSortCount(Integer id, Integer sort);

    /**
     * 首页轮播图
     * @return
     */
    List<Garousel> getGarousel();
}
